from pydantic import BaseModel
from typing import Any


class ResponseModel(BaseModel):
    data: Any
    code: str
    message: str


class UserBase(BaseModel):
    username: str
    phone: str
    address: str


class UserLogin(BaseModel):
    username: str
    password: str


class UserCreate(UserBase):
    password: str
    department_id: int


class DepartmentSchema(BaseModel):
    department_id: int
    department_name: str

    class Config:
        from_attributes = True


class User(UserBase):
    user_id: int
    department_id: int
    department: DepartmentSchema

    class Config:
        from_attributes = True
